package com.hundsun.fcp.activity;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

import com.hundsun.fcp.R;
import com.hundsun.fcp.base.BaseActivity;
import com.hundsun.fcp.common.AppointFiled.SharePlatformType;
import com.hundsun.fcp.common.ShareWindow;

public class MineShareActivity extends BaseActivity implements OnClickListener{

	private ImageView mWeixin;
	
	private ImageView mPengyouquan;
	
	private ImageView mWeibo;
	
	private ImageView mQQ;
	
	private ShareWindow mShareWindow ;
	@Override
	protected int getContentLayout() {
		return R.layout.fcp_mine_share;
	}
	@Override
	protected void initHeader() {
		super.initHeader();
		mHeaderMenu.setTitle(R.string.mine_share_friend);
	}
	@Override
	public void initView() {
		super.initView();
		mShareWindow = new ShareWindow(this) ;
		mWeixin = (ImageView) findViewById(R.id.iv_weixin);
		mPengyouquan = (ImageView) findViewById(R.id.iv_pengyouquan);
		mWeibo = (ImageView) findViewById(R.id.iv_weibo);
		mQQ = (ImageView) findViewById(R.id.iv_qq);
		
		mWeixin.setOnClickListener(this);
		mPengyouquan.setOnClickListener(this);
		mWeibo.setOnClickListener(this);
		mQQ.setOnClickListener(this);
		
	}
	@Override
	public void onClick(View v) {
		int platformType = 0 ;
		//通过微信分享
		if(v == mWeixin){
			platformType = SharePlatformType.WEIXINCHAR ;
		}
		//通过朋友圈分享
		else if(v == mPengyouquan){
			platformType = SharePlatformType.WEIXINCIRCLE ;
		}
		//通过微博分享
		else if(v == mWeibo){
			platformType = SharePlatformType.SINA ;
		}
		//通过QQ分享
		else if(v == mQQ){
			platformType = SharePlatformType.QQ ;
		}
		mShareWindow.sharePlatform("test", platformType) ;
	}

}
